<template>
  <div>
    {{ name }}
    <slot :user="user"></slot>
    <div>{{ model }}</div>
    <button @click="">增加</button>
    <span>子组件2</span>
    <div>数值： {{ count }}</div>
    {{ name }}
    <Child />
  </div>
</template>
<script setup lang="ts">
import { ref, inject,computed } from "vue";
import { storeToRefs } from "pinia";
import { useAppStore } from "@/stores/index";
import Child from "./child2.vue";

const count = inject("count");
const appStore = useAppStore();

// const name = computed(() => appStore.name);
const { name } = storeToRefs(appStore);
const model = defineModel();
const user = ref({ name: "张三" });
const props = defineProps({
  msg: String,
});
</script>
